Skip to content

Conversation

sanych-sun
Copy link
Member

While migrating to unified spec format for transactions tests in CSHARP Driver I've run into 2 minor problems which I suggest to fix by this PR (please let me know if the changes makes sense and I'll create an appropriate ticket):

  1. CSharp Driver does not write default values for optional fields, that's why we should make 'new' field of findOneAndModify command optional ({ $$unsetOrMatches: false })
  2. When there is a failPoint set on hello command, I suggest to use appName to let other connection work (we use additional client to setup and tire down the failpoints).

@sanych-sun sanych-sun requested a review from a team as a code owner January 9, 2025 20:23
@sanych-sun sanych-sun requested review from durran and removed request for a team January 9, 2025 20:23
@ShaneHarvey
Copy link
Member

Could you open a DRIVERS ticket for this change and link it here?

@sanych-sun sanych-sun changed the title Minor updates to transaction specs DRIVERS-3081: Relax requirement for optional fields and introducing appName for failPoints for transactions unified tests Jan 9, 2025
@@ -572,6 +573,7 @@ tests:
- isMaster
- hello
closeConnection: true
appName: *appName
Copy link
Member

@ShaneHarvey ShaneHarvey Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these transaction test changes look good. I believe we couldn't use this feature originally because of this server bug: SERVER-49336. Can you confirm that these tests pass on current 4.2 and up servers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the tests are green.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 possible fixes for now: use appName with additional connection for failPoints OR simply wait for all failPoints to be processed and then remove fialPoint (the second approach makes us waste around of 3-4 seconds waiting)

@ShaneHarvey
Copy link
Member

I'm testing this in Python here: mongodb/mongo-python-driver#2058

Will report back on the status.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass in Python, LGTM!

@sanych-sun sanych-sun merged commit c9da50d into mongodb:master Jan 15, 2025
5 checks passed
@sanych-sun sanych-sun deleted the mark-new-as-optional-findAndModify branch January 15, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants